//其他下载方法可进入源码末尾查看
let ret = 蓝奏云链接解析("https://wwa.lanzoui.com/i7AVivmwdyh")
logd(JSON.stringify(ret));
http.downloadFileDefault(ret.url, "/sdcard/Pictures/" + ret.filename)


/**
 * @author Mr_老冷 QQ:1920712147
 * @description 蓝奏云链接解析,末尾附下载方法
 * @param url {string} 蓝奏云链接
 * @return {boolean|Object} {filename:"xxxx",byte:"xxxx"}
 */
function 蓝奏云链接解析(url) {
    let derectConnetion;
    let forceLink = url.replace(/com\//, "com/tp/");
    let FL = forceLink.match("https://" + '(.*?)' + "lanzou");
    if (FL) {
        forceLink = forceLink.replace(FL[1], "");
    } else {
        logd("url错误")
        return false
    }
    let html = http.httpGet(url, null, 10 * 1000, {
        'User-Agent': 'Mozilla/5.0 (Linux; U; Android 10; zh-cn; SKW-A0 Build/SKYW2007160CN00MQ3) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/71.0.3578.141 Mobile Safari/537.36 XiaoMi/MiuiBrowser/12.7.20',
    })
    let ishtml = html.match(/\'\?(.*?)\'/)
    if (ishtml) {
        html = http.httpGet(url, null, 10 * 1000, {
            'User-Agent': 'Mozilla/5.0 (Linux; U; Android 10; zh-cn; SKW-A0 Build/SKYW2007160CN00MQ3) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/71.0.3578.141 Mobile Safari/537.36 XiaoMi/MiuiBrowser/12.7.20',
        })
    } else {
        html = http.httpGet(forceLink, null, 10 * 1000, {
            'User-Agent': 'Mozilla/5.0 (Linux; U; Android 10; zh-cn; SKW-A0 Build/SKYW2007160CN00MQ3) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/71.0.3578.141 Mobile Safari/537.36 XiaoMi/MiuiBrowser/12.7.20',
        })
    }
    if (html.search('placeholder="输入密码"/>') >= 0) {
        let agvSome = eval("参数 = " + html.substring(html.search("{ 'action':'downprocess'"), html.search("','p':pwd")) + "','ves':'1','websign':'2'}");
        let requestLink = url.replace(url.match(/com\/(\S*)/g)[0], "com/ajaxm.php");
        let data = http.httpPost(requestLink, agvSome, null, 10 * 1000,
            {"Referer": url.replace(/com\//, "com/tp/")}
        )
        derectConnetion = data["dom"] + "/file/" + data["url"];
    } else {
        derectConnetion = "https://vip.d0.baidupan.com/file/?" + html.match(/\'\?(.*?)\'/)[1] + ""
    }
    url = http.requestEx({
        method: "GET",
        url: derectConnetion + "",
        "followRedirects": false,
        header: {
            'Accept-Language': 'zh-CN,en-US;q=0.9',
        },
        'userAgent': 'Mozilla/5.0 (Linux; U; Android 10; zh-cn; SKW-A0 Build/SKYW2007160CN00MQ3) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/71.0.3578.141 Mobile Safari/537.36 XiaoMi/MiuiBrowser/12.7.20',
    });
    url = url.header.Location
    //下载方式1
    // http.downloadFile(url, "/sdcard/Pictures/1.zip", 20 * 1000, null)
    let ret = laoleng.jsoup.get(url, 20 * 1000, "byte")
    if (ret) {
        return {
            filename: decodeURIComponent(ret.filename),
            url: url
        }
    }
    //下载方式2
    // laoleng.files.wirteBytes("/sdcard/Pictures/" + decodeURIComponent(ret.filename), ret.byte)
}